#!/bin/bash 

echo "Creating persistent Ghost data directory"
if [ ! -d "$OPENSHIFT_DATA_DIR/content/data" ]; then
	mkdir -p $OPENSHIFT_DATA_DIR/content/data
fi
echo "Creating persistent Ghost images directory"
if [ ! -d "$OPENSHIFT_DATA_DIR/content/images" ]; then
	mkdir -p $OPENSHIFT_DATA_DIR/content/images
fi
echo "Symlinking data directory"
rm -rf $OPENSHIFT_REPO_DIR/content/data
ln -sf $OPENSHIFT_DATA_DIR/content/data $OPENSHIFT_REPO_DIR/content/data
echo "Symlinking images directory"
rm -rf $OPENSHIFT_REPO_DIR/content/images
ln -sf $OPENSHIFT_DATA_DIR/content/images $OPENSHIFT_REPO_DIR/content/images


